﻿using Dapper.Contrib.Extensions;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Gx.Model.Entity
{
    [System.ComponentModel.DataAnnotations.Schema.Table("LK_WareHouse")] 
    public class LKWareHouse
    {
        [System.ComponentModel.DataAnnotations.Key]
        private int _id;
        /// <summary>
        /// Id
        /// </summary>
        [Column("Id")]
        public int Id
        {
            get
            {
                return _id;
            }
            set { _id = value; }
        }


        private string _wareHouseName;
        /// <summary>
        /// 仓库名称
        /// </summary>
        [Column("WareHouseName")]
        public string WareHouseName
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_wareHouseName))
                    _wareHouseName = string.Empty;
                return _wareHouseName;
            }
            set { _wareHouseName = value; }
        }


        private string _remark;
        /// <summary>
        /// 备注
        /// </summary>
        [Column("Remark")]
        public string Remark
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_remark))
                    _remark = string.Empty;
                return _remark;
            }
            set { _remark = value; }
        }


        private int _parentId;
        /// <summary>
        /// 主id
        /// </summary>
        [Column("ParentId")]
        public int ParentId
        {
            get
            {
                return _parentId;
            }
            set { _parentId = value; }
        }


        private int _volume;
        /// <summary>
        /// 容量
        /// </summary>
        [Column("Volume")]
        public int Volume
        {
            get
            {
                return _volume;
            }
            set { _volume = value; }
        }


        private System.DateTime _createTime;
        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("CreateTime")]
        public System.DateTime CreateTime
        {
            get
            {
                if (_createTime == DateTime.MinValue)
                {
                    return DateTime.Parse("1911-01-01");
                }
                return _createTime;
            }
            set { _createTime = value; }
        }


        private int _createUserId;
        /// <summary>
        /// 创建人id
        /// </summary>
        [Column("CreateUserId")]
        public int CreateUserId
        {
            get
            {
                return _createUserId;
            }
            set { _createUserId = value; }
        }


        private string _createUser;
        /// <summary>
        /// 创建人
        /// </summary>
        [Column("CreateUser")]
        public string CreateUser
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_createUser))
                    _createUser = string.Empty;
                return _createUser;
            }
            set { _createUser = value; }
        }


        private bool _isDeleted;
        /// <summary>
        /// 是否删除
        /// </summary>
        [Column("IsDeleted")]
        public bool IsDeleted
        {
            get
            {
                return _isDeleted;
            }
            set { _isDeleted = value; }
        }
        private int _companyId;
        /// <summary>
        /// 公司
        /// </summary>
        [Column("CompanyId")]
        public int CompanyId
        {
            get
            {
                return _companyId;
            }
            set { _companyId = value; }
        }

        [Computed]
        public string CompanyName { get; set; }

        [Computed]
        public string state { get; set; }
        [Computed]
        public List<LKWareHouse> children { get; set; }
    }
}

